Skip to content

Transform a file that has no beams section - #240

Merged
webdevred merged 9 commits into
masterfrom
transform-files-without-beams
Aug 28, 2026
Merged

Transform a file that has no beams section#240
webdevred merged 9 commits into
masterfrom
transform-files-without-beams

Conversation

@webdevred

Copy link
Copy Markdown
Owner

Closes #229.

A jbeam file is not obliged to have a beams section, and classifying, sorting and renaming need none. Only support classification reads beams, and without them the answer is simply that no node is a support node. transform fails the whole file instead.

The failure is quiet. The tool prints the reason to stderr and exits 0, so a run over a directory leaves those files untouched and reports nothing. That is the same shape as the parse failures fixed in #238, where 97 stock files were silently skipped.

A jbeam file is not obliged to have a beams section, and classifying,
sorting and renaming need none. Only support classification reads beams,
and without them the answer is that there are no support nodes. transform
fails the whole file instead, and the tool still exits 0, so a run over a
directory leaves such files untouched without saying why.
The spec said it classified nothing as support and only counted the nodes,
which stays at four whether or not a support tree is created, since support
extraction moves nodes rather than dropping them. It now looks for the side
comment the transformation writes above a support tree, which is absent
exactly when no such tree exists.
The four that cannot hold a comment are right to return nothing, but the
wildcard would have returned nothing for a new constructor that can hold one,
and the spec would have gone green for having looked in the wrong place.
Naming them makes GHC refuse to compile when Node grows.
The spec that looked for a missing "Support nodes" comment could not
fail: a vertex absent from the connection map is skipped, so an empty map
gives an empty result whatever the fix does. The count vertexConns
produces is the thing that actually depends on the beams section, and it
returns Left today rather than an empty map. The fixture with three
beamed hubs stands next to it, so the negative means something.
@webdevred
webdevred marked this pull request as ready for review August 28, 2026 19:56
@webdevred
webdevred merged commit 3667397 into master Aug 28, 2026
13 checks passed
@webdevred
webdevred deleted the transform-files-without-beams branch August 28, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--transform fails on a file with no beams section, and exits 0

1 participant